import 'package:flutter_test/flutter_test.dart';
import 'package:platform_image_saver/platform_image_saver.dart';
import 'package:platform_image_saver/platform_image_saver_platform_interface.dart';
import 'package:platform_image_saver/platform_image_saver_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockPlatformImageSaverPlatform
    with MockPlatformInterfaceMixin
    implements PlatformImageSaverPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final PlatformImageSaverPlatform initialPlatform = PlatformImageSaverPlatform.instance;

  test('$MethodChannelPlatformImageSaver is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelPlatformImageSaver>());
  });

  test('getPlatformVersion', () async {
    PlatformImageSaver platformImageSaverPlugin = PlatformImageSaver();
    MockPlatformImageSaverPlatform fakePlatform = MockPlatformImageSaverPlatform();
    PlatformImageSaverPlatform.instance = fakePlatform;

    expect(await platformImageSaverPlugin.getPlatformVersion(), '42');
  });
}
